Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <img src="klematis.jpg" alt="flower" width="150" height="113"> <img src="klematis2.jpg" alt="flower" width="152" height="128"> <img src="smiley.gif" alt="Smiley face" width="42" height="42"> <p>Click the button to display the URL of the first image (index 0) in the document.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = document.images[0].src; document.getElementById("demo").innerHTML = x; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_doc_images3 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:10:53 GMT --> </html>
Result:
Try it Yourself - © w3schools.com